package com.heima.admin.controller;

import com.heima.admin.dto.AdminDto;
import com.heima.admin.service.IAdUserService;
import com.heima.common.dto.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 登录系统操作
 */
@RestController
@RequestMapping("/login")
@Api(tags = "登录系统")
public class LoginController {
    @Autowired
    private IAdUserService adUserService;
    @PostMapping("/in")
    @ApiOperation(value = "登录",notes = "author:ztz")
    @ApiImplicitParam(dataType = "AdminDto",value = "账户密码对象",name = "dto")
    public ResponseResult login(@RequestBody AdminDto dto){
        return adUserService.login(dto);
    }
}
